import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    // 主界面
    {
      path: '/', 
      redirect: '/ranshaoshuzihuajiance'
    }, 
    // {
    //   path: '/index', 
    //   name: 'index',
    //   component: () => import('../view/index.vue'),
    // }, 
    // 燃烧稳定性监测
    {
      path: '/ranshaowendingxing',
      name: 'ranshaowendingxing',
      component: () => import('../view/ranshaowendingxing.vue'),
    },
     // 燃烧数字化监测
    {
      path: '/ranshaoshuzihuajiance',
      name: 'ranshaoshuzihuajiance',
      component: () => import('../view/ranshaoshuzihuajiance.vue'),
    },
    //  煤粉分配率
    {
      path: '/meifen',
      name: 'meifen',
      component: () => import('../view/meifen.vue'),
    },
    // 预警信息
    {
      path: '/yujing',
      name: 'yujing',
      component: () => import('../view/yujing,.vue'),
    },
    // 历史数据
    {
      path: '/history',
      name: 'history',
      component: () => import('../view/history.vue'),
    },
    {
      path: '/history0',
      name: 'history0',
      component: () => import('../view/history0.vue'),
    },
    {
      path: '/indexs',
      name: 'indexs',
      component: () => import('../view/indexs.vue'),
    },
    {
      path: '/_shuzhicanshe_baiyinhua_.',
      name: '_shuzhicanshe_baiyinhua_.',
      component: () => import('../view/_shuzhicanshe_baiyinhua_..vue'),
    }, 
    
  ]
})
router.beforeEach((to, from, next) => {
  // 在跳转前判断页面是否有缓存，如果有则清除
  if (to.meta.clearCache) {
    sessionStorage.clear()
  }
  next()
})
export default router
